package com.zzl.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.system.common.pojo.BisCashRecord;
import com.zzl.service.BisCashRecordService;


@Controller
@RequestMapping("bcr")
public class BisCashRecordController {
	@Autowired
	private BisCashRecordService bisCashRecordService;
	@RequestMapping("listbcr")
	public String listbcr(Model model,HttpServletRequest request){
		Map<String,Object> map=getParatems(request);
		List<BisCashRecord> list=bisCashRecordService.select(map);
		model.addAttribute("list", list);
		return "/bis_cash/bcrList";
	}
	private Map<String, Object> getParatems(HttpServletRequest reuest){
		Map<String,Object> map=new HashMap<>();
		String qorderId = reuest.getParameter("qorderId");
		if(qorderId!=null&&qorderId!=""){
			map.put("qorderId", qorderId);
		}
		String qcustomUserId = reuest.getParameter("qcustomUserId");
		if(qcustomUserId!=null&&qcustomUserId!=""){
			map.put("qcustomUserId", qcustomUserId);
		}
		String qcustomUserName = reuest.getParameter("qcustomUserName");
		if(qcustomUserName!=null&&qcustomUserName!=""){
			map.put("qcustomUserName", qcustomUserName);
		}
		String qpayWay = reuest.getParameter("qpayWay");
		if(qpayWay!=null&&qpayWay!=""){
			map.put("qpayWay", qpayWay);
		}
		String qrecordTypPpe = reuest.getParameter("qrecordTypPpe");
		if(qrecordTypPpe!=null&&qrecordTypPpe!=""){
			map.put("qrecordTypPpe", qrecordTypPpe);
		}
		String qstartTime = reuest.getParameter("qstartTime");
		if(qstartTime!=null&&qstartTime!=""){
			map.put("qstartTime", qstartTime);
		}
		String qendTime = reuest.getParameter("qendTime");
		if(qendTime!=null&&qendTime!=""){
			map.put("qendTime", qendTime); 
		}
		return map;
		
	}
}
